#include <iostream>
#include <vector>
#include <algorithm>
using namespace std;

/*
下面的程序从用户读入测试分数，检查是否存在“完美”分数。
完美分数批的是大于等于100的分数。
*/
bool perfectScore(int num)
{
    return (num >=100);
}
int main()
{
    int num;
    vector<int> myVector;
    while(true){
        cout << "Enter a test score to add( 0 to stop): ";
        cin >> num;
        if(num == 0){
            break;
        }
        myVector.push_back(num);
    }
    auto end = myVector.end();
    auto it = find_if(myVector.begin(),end,perfectScore);
    if (it == end){
        cout << "No perfect scores" << endl;
    }else{
        cout << "Found a \"perfect\" score of " << *it << endl;
    }
    return 0;
}